package com.mybatis.dao;

import com.mybatis.pojo.User;
import org.apache.ibatis.annotations.*;

/**
 * 注解开发
 */
@CacheNamespace//开启二级缓存
@Mapper
public interface UserDao2 {

    @Select("select id,username,sex,address from user where id=#{id}")
    User queryUserById(Integer id);

    @Update("update user set username=#{user.username} where id=#{user.id}")
    Integer updateUser(@Param("user") User user);
}
